package com.ktjy.sample.entity;

import org.apache.log4j.Logger;

public class Pet {
    private Logger logger = Logger.getLogger(Pet.class);
    private String name; //  宠物名字
    private String age; //  宠物年龄

    public Pet() {
        System.out.println("我们喜欢时代少年团");
    }

    public Pet(String name, String age) {
        this.name = name;
        this.age = age;
    }
    //自我介绍
    public void introduce() {
        System.out.println("我的名字叫：" + name + "，我的年龄是：" + age);
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    public String toString() {
        return "Pet{name = " + name + "}";
    }

    /**
     * 获取
     * @return age
     */
    public String getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(String age) {
        logger.debug("Pet对象的setAge方法被调用!age={}"+age);
        this.age = age;
    }
}
